
export default {
  namespaced: true,
  state: {
    title: 'loader-module',
    token: null,
    member:null,
    memberTeamList:null,
    modeTeamList:[
      {id:1,name:'测试公司1',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:2,name:'测试公司2',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:3,name:'测试公司3',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:4,name:'测试公司4',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:5,name:'测试公司5',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:6,name:'测试公司6',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
      {id:7,name:'测试公司7',logo:'https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png'},
    ],
    modeModuleList:[]
  },
  mutations: {
    SET_TOKEN(state,token){
      console.log('SET_TOKEN',token)
      state.token = token
      if(!token) router.push('/login')
      else {
        console.log('去处理？')
      }
    },
    SET_MEMBER(state,info){
      console.log('info----',info)
      state.member=info
    },
    SET_MODULELIST(state,list){
      state.modeModuleList=list
    }
  },
  actions:{//this.$store.dispath('loaer/login')
    login ({commit},token) {
      window.sessionStorage.removeItem('token')
      window.sessionStorage.setItem('token',token)
      commit('SET_TOKEN',token)
    },
    logout({commit}){
      window.sessionStorage.removeItem('token')
      commit('SET_TOKEN',null)
    },
  },
}
